#ifndef _MiniLibOK
#define _MiniLibOK
#include <cstdint>
#include <list>
#include <stdio.h>
#include <stdint.h>
#include <stdarg.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
#include <getopt.h>
#include <typeinfo>
#include <tuple>
#include <string>

#define DPORT 0
#define ERRO_REPROT(var, whats)                                                \
    if (var < 0) {                                                               \
        MiniError("%s Error!", whats);  \
        fMiniLog(LogOut, "异常退出\n");  \
        exit(1);                                                                   \
    }

extern FILE *LogOut;

extern void ctrlc(int sig);
extern int8_t InitMiniLog();
extern void CloseMiniLog();
extern void vfMiniLog(FILE *where, const char *fmt, va_list args);
extern void fMiniLog(FILE *where, const char *fmt, ...);
extern void MiniLog(const char *fmt, ...);
extern void MiniError(const char *fmt, ...);
// static bool first=true;
// template<class ...Ts> void dgetopt(int argc,char **argv,std::tuple<Ts...> tup1){
    //too hard!!!!!!!!!!
// }
extern uint16_t HttpReadLine(std::string &buff,uint32_t client_socket);
extern uint16_t send2client(uint32_t socket,std::string &wpath);
extern bool notfound(uint32_t socket);
// struct HttpStrNode{
//     HttpStrNode(const char *buf);
//     char * buff;
//     HttpStrNode *next;
//     ~HttpStrNode();
// };
// struct HttpStrList{
//     HttpStrNode *head;
//     HttpStrList(): head(new HttpStrNode("head")){
//         head->next=nullptr;
//     };
//     ~HttpStrList();
//     void Add(char *buff);
//     void Add(HttpStrList &List);
//     private:
//     void deepcopy();
// };

#endif